home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Mar. 14, 1997
- // Author: ms
- //
- // Description:
- // Produce a lofted surface through the curves, but have it so that
- // the resulting surface's CVs go through the original curves' CVs,
- // rather than having the surface going through the curves.
-
- global proc string alternativeLoft()
- {
- int $hist = `constructionHistory -q -tgl`;
-
- global int $gSelectNurbsCurvesBit;
- global int $gSelectIsoparmsBit;
- global int $gSelectCurvesOnSurfacesBit;
- global int $gSelectSurfaceEdgeBit;
-
- string $curves[] = `filterExpand -ex true -sm $gSelectNurbsCurvesBit -sm $gSelectIsoparmsBit -sm $gSelectCurvesOnSurfacesBit -sm $gSelectSurfaceEdgeBit`;
-
- string $surface = "";
-
- int $n = size($curves);
- int $i;
-
- if( $n < 2 ) return $surface;
-
- string $cmd = "loft -ch " + $hist + " ";
-
- // Rebuild them into linears (keep cvs):
- for( $i=0; $i<$n; $i+=1 ) {
- string $now[] = `rebuildCurve -ch $hist -rpo false -kcp on -d 1 -rt 0 $curves[$i]`;
- $curves[$i] = $now[0];
- $cmd = $cmd + $curves[$i] + " ";
- }
-
- // Convert back into cubic:
- string $res[] = eval($cmd);
- if( size($res) > 0 ) {
- $surface = $res[0];
- rebuildSurface -ch $hist -rpo true -kcp on -du 3 -dv 3 -rt 0 $surface;
- }
-
- if( !$hist ) {
- for( $i=0; $i<$n; $i+=1 ) {
- delete $curves[$i];
- }
- }
-
- select -r $surface;
- return $surface;
- }
-